
<!--
	<p>
	<button ng-click="about.oauth()">oauth</button>
	</p>
<div>
	<uib-alert ng-repeat="alert in mine.alerts" type="{{alert.type}}">{{alert.msg}}</uib-alert>
</div>
name:{{mine.user.name}}<br>
mobile:{{mine.user.mobile}}<br>
beans:{{mine.user.beans}}<button ng-click="mine.charge()">buy some</a><br>
-->
<script type="text/ng-template" id="confirm.html">
	<div class="modal-header">
		<h4 class="modal-title">充值成功</h4>
	</div>
	<div class="modal-body">
		<button class="btn btn-danger" ng-click="close()">确定</button>
	</div>
</script>

<script type="text/ng-template" id="redeem.html">
	<div class="modal-header">
		<h3 class="modal-title">使用兑换码兑换糖豆</h3>
	</div>
	<div class="modal-body">
		<input type="text" ng-model="code" placeholder="在此输入兑换码"><br>
	</div>

	<div class="modal-footer">
		<button class="btn btn-primary" ng-click="redeem( code )">兑换</button>
	</div>
</script>

<script type="text/ng-template" id="charge.html">
	<div class="modal-header">
		<h3 class="modal-title">充值糖豆</h3>
	</div>
	<div class="modal-body">
		<input type="number" ng-model="beans" ng-init="beans=1" min=1><br>
		<lable>需支付 {{ 40 * beans}}￥</lable><br>
	</div>

	<div class="modal-footer">
		<button class="btn btn-primary" ng-click="charge( beans )">充值</button>
	</div>
</script>

<div class="mine">
	<p>
	<a ng-click="mine.openChargeModal()" class="left" role="button">充值</a>
	<a ng-click="mine.openRedeemModal()" class="right" role="button">兑换</a>
	</p>
	<div><h1><img src="http://7xlkfc.com2.z0.glb.qiniucdn.com/bean.png"/><font>&nbsp;X&nbsp;</font><span>{{mine.user.beans || 0}}</span></h1></div>
</div>
<div>
	<uib-accordion close-others="true">
		<uib-accordion-group is-open="mine.status[0]">
			<uib-accordion-heading>
				充值记录<i role="button" class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': mine.status[0], 'glyphicon-chevron-right': !status[0]}"></i>
			</uib-accordion-heading>
			<div class="row" ng-repeat="order in mine.orders | orderBy:'-time'">
				<div class="col-md-6">
					{{order.beans}}颗({{order.cost}}￥)
				</div>
				<div class="col-md-6" style="text-align:right">
					{{order.time | dateFilter}}
				</div>
			</div>
		</uib-accordion-group>

		<uib-accordion-group is-open="mine.status[1]">
				<!--<button class="btn btn-primary"> hello world </button> -->
			<uib-accordion-heading>
				课程包订单<i role="button" class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': mine.status[1], 'glyphicon-chevron-right': !status[1]}"></i>
			</uib-accordion-heading>
			<div ng-repeat="wrapper in mine.courseWrappers" style="border-bottom:inset;margin-bottom:10px;">
				<p><strong>{{wrapper.gym.name}}</strong></p>
				<div class="row" ng-repeat="package in wrapper.packageLessonReceipts">
					<div class="col-md-6">
						<a ui-sref="course(package.packageLesson)">
							{{package.packageLesson.title}}
						</a>
					</div>
					<div class="col-md-6" style="text-align:right">
						{{ package.finishedReceipts.length ? package.finishedReceipts[0].createdTime : package.bookedReceipts[0].createdTime | dateFilter }}
					</div>
				</div>
			</div>
		</uib-accordion-group>

		<uib-accordion-group is-open="mine.status[2]">
				<!--<button class="btn btn-primary"> hello world </button> -->
			<uib-accordion-heading>
				团体次课订单<i role="button" class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': mine.status[2], 'glyphicon-chevron-right': !status[2]}"></i>
			</uib-accordion-heading>
			<div ng-repeat="wrapper in mine.lessonWrappers" style="border-bottom:inset;margin-bottom:10px;">
				<p><strong>{{wrapper.gym.name}}</strong></p>
				<div class="row" ng-repeat="receipt in wrapper.receipts">
					<div class="col-md-6">
						<a ui-sref="lesson(receipt.lesson)">
							{{receipt.lesson.course.title}}
						</a>
					</div>
					<div class="col-md-6" style="text-align:right">
						{{ receipt.createdTime | dateFilter }}
					</div>
				</div>
			</div>
		</uib-accordion-group>

		<uib-accordion-group is-open="mine.status[3]">
				<!--<button class="btn btn-primary"> hello world </button> -->
			<uib-accordion-heading>
				私教次课订单<i role="button" class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': mine.status[3], 'glyphicon-chevron-right': !status[3]}"></i>
			</uib-accordion-heading>
			<div ng-repeat="wrapper in mine.ptWrappers" style="border-bottom:inset;margin-bottom:10px;">
				<p><strong>{{wrapper.gym.name}}</strong></p>
				<div class="row" ng-repeat="receipt in wrapper.receipts">
					<div class="col-md-6">
						<a ui-sref="lesson(receipt.lesson)">
							{{receipt.lesson.coach.name}}
						</a>
					</div>
					<div class="col-md-6" style="text-align:right">
						{{ receipt.createdTime | dateFilter }}
					</div>
				</div>
			</div>
		</uib-accordion-group>

	</uib-accordion>
</div>

<!--
<div class="container">
	<uib-alert ng-repeat="alert in mine.alerts" type="danger">{{alert}}</uib-alert>
</div>
-->

<toaster-container>
</toaster-container>
